Repository navigation
feat(devops): Phase 10 — Docker, compose, metrics, CI workflows - #29
Merged
Merged
Conversation
Add a dependency-free metrics registry (counters, histograms, gauges) exposed at GET /metrics with Prometheus text exposition format 0.0.4. Middleware records http_requests_total by method/route/status and http_request_duration_seconds with cumulative buckets; process gauges (rss, heap, uptime) are refreshed on every scrape.
Add production-ready Dockerfiles for the API (multi-stage node:20-alpine with workspace pruning), web (vite build served by nginx:alpine) and AI service (python:3.13-slim). Replace the postgres-only docker-compose.yml with a full five-service stack (postgres, api, web, ai, nginx) with health checks, signed job token wiring and a reverse proxy that routes /api/, /metrics and /socket.io/ to their respective containers.
Add security.yml (weekly + PR): npm audit --audit-level=high and pip-audit on the AI service. Add docker.yml: builds all four images (api, web, ai, nginx) on push/PR to validate Dockerfiles.
Add wheel>=0.46.2 to the AI service dev extras so fresh CI environments pick up the patched build dependency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
Prometheus metrics (api)
A dependency-free metrics registry (counters, histograms, gauges) exposed at
GET /metricswith Prometheus text exposition format 0.0.4. Middleware recordshttp_requests_totalby (method, route, status) andhttp_request_duration_secondswith cumulative buckets; process gauges (rss, heap, uptime) refresh on every scrape.Dockerfiles (web / api / ai)
node:20-alpinebuild: installs workspaces, prunes dev deps, runs asnodeuser.node:20-alpineruns the Vite build (VITE_API_URL=/api/v1),nginx:alpineserves the static dist.python:3.13-slim: pip-installs the package, runs as a non-root user.Full stack compose
docker-compose.ymlnow defines five services: postgres (pgvector, existing), api, web, ai and nginx — all wired with health checks, secret env vars and a reverse proxy at:8080that routes/api/,/socket.io/(websocket upgrade) and/metricsto their containers.Nginx reverse proxy
infrastructure/nginx/—nginx.conf+ Dockerfile. Proxies/api/to api:4000,/metricsto api:4000,/socket.io/with upgrade headers, and/to web:80.CI workflows
npm audit --audit-level=high+pip-auditon push/PR and weekly.CVE fix
Pin
wheel>=0.46.2in the AI service dev extras to resolve CVE-2026-24049 in the build environment.Tests
220 API tests (216 + 4 new metrics tests), 84 web tests, 15 database tests, 145 AI pytest tests (1 skipped locally — requires Docker). Root lint, build, validate, ruff all clean.